﻿using OA.Model.MyAttribute;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
//using System.Web.DynamicData;

namespace OA.Model
{
    //[TableName("知识分组表")]
    [Table("KnowledgeGroup")]
    public class KnowledgeGroup : BaseInfo
    {
        public int Status { get; set; }

        [Display(Name = "分组名称")]
        [MaxLength(10)]
        [Required]
        [Tag(TagEnum.Text, "required", "分组名称", 2, 10)]
        public string Name { get; set; }

        [Display(Name = "排序")]
        [Tag(TagEnum.Number, "required", "分组排序", 0, 100)]
        public int Sort { get; set; }

    }

    public class SimpleKnowledgeGroup : SimpleInfo
    {
        public string Name { get; set; }

        public int Sort { get; set; }

        public static Expression<Func<KnowledgeGroup, SimpleKnowledgeGroup>> Map = m => new SimpleKnowledgeGroup()
        {
            ID = m.ID,
            Name = m.Name,
            Sort =m.Sort
        };
    }

    public class SimpleKnowledgeGroup2 : SimpleInfo
    {
        public string name { get; set; }

        public int Sort { get; set; }

        public static Expression<Func<KnowledgeGroup, SimpleKnowledgeGroup2>> Map = m => new SimpleKnowledgeGroup2()
        {
            ID = m.ID,
            name = m.Name,
            Sort = m.Sort
        };
    }
}
